package com.indusfo.spc.mapper;

import com.indusfo.spc.pojo.MatStation;
import com.indusfo.spc.pojo.OrderFlow;
import com.indusfo.spc.pojo.OrderStation;
import com.indusfo.spc.pojo.OrderStation;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @Author liub
 * @Date 2019/11/26 9:29
 * @Version 1.0
 */

public interface OrderStationMapper {
    /**
     * 新增
     */
    int insertOrderStation(OrderStation orderStation);

    /**
     * 修改
     */
    int updateOrderStation(OrderStation orderStation);

    /**
     * 查询
     */
    List<OrderStation> queryOrderStation(OrderStation orderStation);

    /**
     * 总数
     */
    int countOrderStation(OrderStation orderStation);

    /**
     * 判重
     */
    int checkOrderStation(OrderStation orderStation);

    /**
     * 启停
     */
    int deleteOrderStation(@Param("orderStationIds") List<Integer> orderStationIds, @Param("dataState") Integer dataState);

    /**
     * 级联删除查询
     */
    List<OrderStation> queryOrderStationByOrderFlowId(@Param("orderFlowId") Integer orderFlowId);

    /**
     * 级联删除
     */
    int deleteOrderStationByOrderStationId(@Param("orderStationId") Integer orderStationId, @Param("dataState") Integer dataState);

    /**
     * 将产品流程下的工序流程下的工位批量新增到任务单流程下的工序流程下的工位上
     * @param matStationList
     * @return
     */
    int insertOrderStationByMatStationList(@Param("matStationList") List<MatStation> matStationList);
    /**
     * @Author 熊冰 通过流程id  查询所有的工位
     * @Date 2020/4/20 10:37
     */
	List<OrderStation> queryOrderStationByOrderFlowList(@Param("orderFlowList")List<OrderFlow> orderFlowList);
}